package com.ddwl.wallet.controller;

import com.ddwl.common.annotation.Auth;
import com.ddwl.common.constant.BaseEnum;
import com.ddwl.common.controller.BaseController;
import com.ddwl.schema.vo.base.RestVo;
import com.ddwl.wallet.service.UserWalletService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * 类WalletApiController.java的实现描述：TODO
 *
 * @author zach
 * @Date :2020-12-07 19:13.
 */

@RestController
public class WalletApiController extends BaseController {

    @Resource
    private UserWalletService userWalletService;

    @GetMapping("/user/amount/list")
    @ApiOperation(value = "获取用户账户金额")
    @Auth(product = BaseEnum.ProductEnum.API)
    public RestVo<Map<String, BigDecimal>> queryUserWalletList(@RequestBody List<String> userIds) {
        return RestVo.ok(userWalletService.queryUserWalletList(userIds));
    }
}
